package hk.m4s.lr.repair.test.ui.goods;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import framework.common.baseui.UeBaseActivity;
import hk.m4s.lr.repair.test.R;

/**
 * Created by qi.wang on 2017/12/4.
 * 付款
 */

public class PayMoneyActivity extends UeBaseActivity{
    private int wxState=0;
    private int zfbState=0;
    private int cardState=0;
    private ImageView next_wx_img,next_zfb_img,next_card_img;
    private TextView takeBuy;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseSetContentView(R.layout.activity_order_pay);
        hiddenFooter();
        showGoBackBtn();
        next_wx_img=(ImageView)findViewById(R.id.next_wx_img);
        next_zfb_img=(ImageView)findViewById(R.id.next_zfb_img);
        next_card_img=(ImageView)findViewById(R.id.next_card_img);
        takeBuy=(TextView)findViewById(R.id.take_buy);
        setTitleText("收银台");

    }
    public void onClick(View view){
        switch (view.getId()){
            case R.id.click_select_wx:
                if(wxState==1){
                    wxState=0;
                    next_wx_img.setImageResource(R.mipmap.shopcheck);
                }else{
                    wxState=1;
                    next_wx_img.setImageResource(R.mipmap.shopchecked);
                    next_zfb_img.setImageResource(R.mipmap.shopcheck);
                    next_card_img.setImageResource(R.mipmap.shopcheck);
                    takeBuy.setText("微信支付");
                }
                zfbState=0;
                cardState=0;
                break;
            case R.id.click_select_zfb:
                if(zfbState==1){
                    zfbState=0;
                    next_zfb_img.setImageResource(R.mipmap.shopcheck);
                }else{
                    zfbState=1;
                    next_wx_img.setImageResource(R.mipmap.shopcheck);
                    next_zfb_img.setImageResource(R.mipmap.shopchecked);
                    next_card_img.setImageResource(R.mipmap.shopcheck);
                    takeBuy.setText("支付宝支付");
                }
                wxState=0;
                cardState=0;
                break;
            case R.id.click_select_card:
                if(cardState==1){
                    cardState=0;
                    next_card_img.setImageResource(R.mipmap.shopcheck);
                }else{
                    cardState=1;
                    next_wx_img.setImageResource(R.mipmap.shopcheck);
                    next_zfb_img.setImageResource(R.mipmap.shopcheck);
                    next_card_img.setImageResource(R.mipmap.shopchecked);
                }
                zfbState=0;
                wxState=0;
                break;
            case R.id.take_buy:
                Intent intent=new Intent(PayMoneyActivity.this,PayMoneySucessActivity.class);
                startActivity(intent);
                finish();
                break;
        }
    }
}
